import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:xeswx/application.dart';
import 'package:xeswx/pages/splash_page.dart';

void main(){
  WidgetsFlutterBinding.ensureInitialized();
  // 设置仅竖屏显示
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitDown,
    DeviceOrientation.portraitUp
  ]);

  
  Application.initLocation();
 
  Provider.debugCheckInvalidValueType = null;
  runApp(MultiProvider(
    providers: [
      // ChangeNotifierProvider<UserModel>(
      //   builder: (_) => UserModel(),
      // ),
      // ChangeNotifierProvider<DiscussModel>(
      //   builder: (_) => DiscussModel(),
      // ),
    ],
    child: MyApp(),
  ));
}

class MyApp extends StatelessWidget {

  
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      // navigatorKey: Application.getIt<NavigateService>().key,
      theme: ThemeData(
          brightness: Brightness.light,
          // primaryColor: Color(int.parse("ffd231",radix:16)|0xFF000000),
          buttonColor: Color(int.parse("ffd231",radix:16)|0xFF000000),
          primaryColor: Colors.white,
          backgroundColor: Colors.white,
          splashColor: Colors.transparent,
          tooltipTheme: TooltipThemeData(verticalOffset: -100000)),
      home: SplashPage(),
      // onGenerateRoute: Application.router.generator,
    );
  }
}
